<?php 
	//error reporting
	ini_set('error_reporting', E_ALL);
	ini_set('display_errors', 1);
	
	//-----------------------------------------------------------------------------------
	include_once("../classes/Database.class.php");
	$db = new Database();
	//-----------------------------------------------------------------------------------
	
	//----------------------------------------
	//GENERO OPTIONS CATEGORIAS
	$data_array = $db->get_data("categorias");	
	$categoria_options = "<option value='' selected='selected'>-- Seleccionar --</option>"; //first value
	foreach($data_array as $record){
		extract($record);
		if(!empty($categoria_options)) $categoria_options.="\n\t\t\t\t\t";
		$nombre=utf8_encode($nombre);
		$categoria_options .= "<option value='$id'>$nombre</option>";
	}
	//----------------------------------------	
	
	//----------------------------------------
	//GENERO OPTIONS PROVEEDORES
	$data_array = $db->get_data("proveedores");	
	$proveedor_options = "<option value='' selected='selected'>-- Seleccionar --</option>"; //first value
	foreach($data_array as $record){
		extract($record);
		$nombre=utf8_encode($nombre);
		if(!empty($proveedor_options)) $proveedor_options.="\n\t\t\t\t\t";
		$proveedor_options .= "<option value='$id'>$nombre</option>";
	}
	//----------------------------------------
?>
															
			<span class="title">Alta de Gastos:</span>
			
			<div class="commentBlock">
				<div class="field_title">Proveedor</div>
				<div class="form_field">
					<select id="proveedor" class="textBox" onfocus="highlight(this)" onblur="unHighlight(this)">
						<?php echo $proveedor_options; ?>
					</select>
					<img src="img/plus.gif" class="handed" onclick="showBox('proveedorBox', 450, 400)" />
				</div>
				
				<div class="field_title">Fecha</div>
				<div class="form_field">
					<input type="text" id="fecha" class="textBox" onfocus="highlight(this)" onblur="unHighlight(this)" />
				 	<img src="components/calendar/calendario.png" name="selfecha1" title="Calendario" alt="" style="cursor:pointer;" onClick="displayCalendar(getObj('fecha'),'dd-mm-yyyy',this)" >
				 	(DD-MM-YYYY)
				</div>
				
				<div class="field_title">Detalle</div>
				<div class="form_field"><textarea id="detalle" class="textBox" onfocus="highlight(this)" onblur="unHighlight(this)"></textarea></div>
				
				<div class="field_title">Monto</div> 
				<div class="form_field"><input type="text" id="monto" class="textBox" onfocus="highlight(this)" onblur="unHighlight(this)" /></div>
				
				<div class="field_title">Categor&iacute;a</div> 
				<div class="form_field">
					<select id="categoria" class="textBox" onfocus="highlight(this)" onblur="unHighlight(this)">
						<?php echo $categoria_options; ?>
					</select>
				</div>
				<br />
				
				<input type="button" id="bInsert" value="Insert" onclick="insertGasto()" />
			</div>	
		</div>
		
						